Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create default aggregation object for easier recursion #6087

Closed
wants to merge 16 commits into from

Conversation

lucasxia01
Copy link
Contributor

Please read contributing guidelines and remove this line.

@AztecBot
Copy link
Collaborator

Benchmark results

Metrics with a significant change:

  • circuit_simulation_time_in_ms (private-kernel-ordering): 136 (-41%)
  • circuit_simulation_time_in_ms (base-parity): 9.08 (-86%)
  • circuit_simulation_time_in_ms (root-parity): 65.8 (-96%)
  • circuit_simulation_time_in_ms (base-rollup): 11,968 (-28%)
  • circuit_simulation_time_in_ms (public-kernel-app-logic): 1,544 (-22%)
  • circuit_simulation_time_in_ms (merge-rollup): 3,179 (-51%)
  • circuit_simulation_time_in_ms (public-kernel-setup): 130 (-42%)
  • circuit_input_size_in_bytes (root-parity): 1,244 (-95%)
  • circuit_input_size_in_bytes (root-rollup): 4,551 (-60%)
  • circuit_output_size_in_bytes (base-parity): 265 (+314%)
  • circuit_output_size_in_bytes (root-parity): 265 (+314%)
  • circuit_output_size_in_bytes (public-kernel-app-logic): 26,202 (+16%)
  • circuit_output_size_in_bytes (public-kernel-teardown): 34,711 (+16%)
  • circuit_output_size_in_bytes (public-kernel-setup): 34,711 (+16%)
  • l2_block_building_time_in_ms (8): 18,806 (-17%)
  • l2_block_building_time_in_ms (32): 72,905 (-18%)
  • l2_block_building_time_in_ms (64): 145,595 (-18%)
  • l2_block_rollup_simulation_time_in_ms (8): 18,599 (-17%)
  • l2_block_rollup_simulation_time_in_ms (32): 72,154 (-18%)
  • l2_block_rollup_simulation_time_in_ms (64): 144,126 (-18%)
Detailed results

All benchmarks are run on txs on the Benchmarking contract on the repository. Each tx consists of a batch call to create_note and increment_balance, which guarantees that each tx has a private call, a nested private call, a public call, and a nested public call, as well as an emitted private note, an unencrypted log, and public storage read and write.

This benchmark source data is available in JSON format on S3 here.

L2 block published to L1

Each column represents the number of txs on an L2 block published to L1.

Metric 8 txs 32 txs 64 txs
l1_rollup_calldata_size_in_bytes 772 (+4%) 772 (+4%) 772 (+4%)
l1_rollup_calldata_gas 6,820 (+2%) 6,832 (+2%) 6,772 (+1%)
l1_rollup_execution_gas 587,301 587,313 587,253
l2_block_processing_time_in_ms 1,478 (-2%) 5,320 (-3%) 10,422
note_successful_decrypting_time_in_ms 158 536 1,126
note_trial_decrypting_time_in_ms 48.1 37.7 50.1
l2_block_building_time_in_ms ⚠️ 18,806 (-17%) ⚠️ 72,905 (-18%) ⚠️ 145,595 (-18%)
l2_block_rollup_simulation_time_in_ms ⚠️ 18,599 (-17%) ⚠️ 72,154 (-18%) ⚠️ 144,126 (-18%)
l2_block_public_tx_process_time_in_ms 8,507 (-5%) 33,247 (-5%) 66,346 (-5%)

L2 chain processing

Each column represents the number of blocks on the L2 chain where each block has 16 txs.

Metric 5 blocks 10 blocks
node_history_sync_time_in_ms 16,247 (-10%) 30,400 (-6%)
note_history_successful_decrypting_time_in_ms 1,344 2,607
note_history_trial_decrypting_time_in_ms 83.6 63.9
node_database_size_in_bytes 20,725,840 37,433,424
pxe_database_size_in_bytes 29,868 59,425

Circuits stats

Stats on running time and I/O sizes collected for every circuit run across all benchmarks.

Circuit circuit_simulation_time_in_ms circuit_input_size_in_bytes circuit_output_size_in_bytes
private-kernel-init 156 (-11%) 47,763 (+2%) 31,978 (+11%)
private-kernel-inner 175 (-15%) 80,794 (+5%) 31,978 (+11%)
private-kernel-ordering ⚠️ 136 (-41%) 57,732 (+9%) 49,313 (+15%)
base-parity ⚠️ 9.08 (-86%) 128 ⚠️ 265 (+314%)
root-parity ⚠️ 65.8 (-96%) ⚠️ 1,244 (-95%) ⚠️ 265 (+314%)
base-rollup ⚠️ 11,968 (-28%) 110,926 957 (+3%)
root-rollup 49.5 (-24%) ⚠️ 4,551 (-60%) 821 (+4%)
public-kernel-app-logic ⚠️ 1,544 (-22%) 62,017 (+14%) ⚠️ 26,202 (+16%)
public-kernel-tail 4,167 (-15%) 168,566 (+6%) 3,812 (-2%)
merge-rollup ⚠️ 3,179 (-51%) 2,760 (+2%) 957 (+3%)
public-kernel-teardown 117 (-28%) 62,017 (+14%) ⚠️ 34,711 (+16%)
public-kernel-setup ⚠️ 130 (-42%) 62,017 (+14%) ⚠️ 34,711 (+16%)

Tree insertion stats

The duration to insert a fixed batch of leaves into each tree type.

Metric 1 leaves 16 leaves 64 leaves 128 leaves 512 leaves 1024 leaves 2048 leaves 4096 leaves 32 leaves
batch_insert_into_append_only_tree_16_depth_ms 10.9 (-1%) 17.7 (-1%) N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_count 16.7 31.8 N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_ms 0.636 (-1%) 0.546 (-1%) N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_32_depth_ms N/A N/A 51.4 (-2%) 79.7 (-1%) 258 (-1%) 501 976 1,929 (-1%) N/A
batch_insert_into_append_only_tree_32_depth_hash_count N/A N/A 95.9 159 543 1,055 2,079 4,127 N/A
batch_insert_into_append_only_tree_32_depth_hash_ms N/A N/A 0.527 (-1%) 0.492 0.471 (-1%) 0.468 0.463 (-1%) 0.462 N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 60.8 (-1%) 119 (-1%) 372 (-1%) 737 (-1%) 1,459 2,900 (-1%) N/A
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 105 208 692 1,363 2,707 5,395 N/A
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.535 (-1%) 0.536 (-1%) 0.507 (-1%) 0.508 0.505 0.506 N/A
batch_insert_into_indexed_tree_40_depth_ms N/A N/A N/A N/A N/A N/A N/A N/A 66.7 (-1%)
batch_insert_into_indexed_tree_40_depth_hash_count N/A N/A N/A N/A N/A N/A N/A N/A 108
batch_insert_into_indexed_tree_40_depth_hash_ms N/A N/A N/A N/A N/A N/A N/A N/A 0.587 (-1%)

Miscellaneous

Transaction sizes based on how many contract classes are registered in the tx.

Metric 0 registered classes 1 registered classes
tx_size_in_bytes 51,411 (+15%) 536,920

Transaction size based on fee payment method

Metric native fee payment method fpc_public fee payment method fpc_private fee payment method
tx_with_fee_size_in_bytes 897 1,145 1,345

Transaction processing duration by data writes.

Metric 0 new note hashes 1 new note hashes 2 new note hashes
tx_pxe_processing_time_ms 1,217 (-14%) 857 (-15%) 3,470 (-7%)
Metric 1 public data writes 2 public data writes 3 public data writes 4 public data writes 5 public data writes 8 public data writes
tx_sequencer_processing_time_ms 831 (-6%) 759 (-5%) 1,362 (-6%) 897 (-6%) 2,066 (-7%) 1,091 (-4%)

@lucasxia01 lucasxia01 self-assigned this May 1, 2024
@lucasxia01
Copy link
Contributor Author

Opted not to modify plonk recursion constraint since a lot of tests would need to be changed, and instead moved the changes to a new honk recursion constraint here: #6489. The new honk recursion constraint therefore always has a default aggregation object when the circuit is recursive.

@lucasxia01 lucasxia01 closed this May 17, 2024
lucasxia01 added a commit that referenced this pull request May 17, 2024
Create new recursion constraint for honk, which is the same as the plonk
recursion constraint, but with a default aggregation object. 
The default aggregation object work was moved from #6087.

This PR is mostly for setup for AztecProtocol/barretenberg#933.
AztecBot pushed a commit to AztecProtocol/barretenberg that referenced this pull request May 18, 2024
Create new recursion constraint for honk, which is the same as the plonk
recursion constraint, but with a default aggregation object. 
The default aggregation object work was moved from AztecProtocol/aztec-packages#6087.

This PR is mostly for setup for #933.
signorecello pushed a commit that referenced this pull request May 20, 2024
Create new recursion constraint for honk, which is the same as the plonk
recursion constraint, but with a default aggregation object. 
The default aggregation object work was moved from #6087.

This PR is mostly for setup for AztecProtocol/barretenberg#933.
@ludamad ludamad deleted the mv/simplify-non-nested-proofs-dsl branch August 22, 2024 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants